#!/bin/bash

# 打印菜单
function print_menu {
    echo "请选择操作："
    echo "1. 查看服务状态"
    echo "2. 开启服务"
    echo "3. 停止服务"
    echo "4. 退出"
}

# 主程序
while true; do
    print_menu
    read -p "请输入选项(1-4):" choice

    case $choice in
        1)
            echo "正在查看 mediaserz 服务状态..."
            systemctl status mediaserz
            ;;
        2)
            echo "正在开启 mediaserz 服务..."
            systemctl start mediaserz
            ;;
        3)
            echo "正在停止 mediaserz 服务..."
            systemctl stop mediaserz
            ;;
        4)
            echo "退出脚本..."
            exit 0
            ;;
        *)
            echo "无效的输入，请重新选择。"
            ;;
    esac
done
